#include<iostream>
using namespace std;
const int N = 1e5 + 10;
int a[N];
int n;
int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++)cin >> a[i];
	int ans = 1;
	for (int i = 2; i <= n; i++) {
		if (a[i] != a[i - 1])ans++;
	}
	cout << ans << endl;
	return 0;
}